package com.zhangyj.component.tags;

import java.io.IOException;
import java.io.Writer;

import javax.servlet.jsp.JspException;

public class TextInputTag extends BaseTag {

	private static final long serialVersionUID = 8083045866920822630L;
	private String type;

	
	public int doStartTag() throws JspException {
		try {
			Writer writer = this.pageContext.getOut();
			writer.append("<input type=\"").append(getType()).append("\" class=\"textbox\"");
			this.writerPublic(writer);

			writer.append(" value=\"");
			writer.append(getObjectFromKey(this.getValue()).toString());
			writer.append("\"");

			writer.append("/>");
		} catch (IOException e) {
			throw new JspException(e);
		} catch (Exception e) {
			throw new JspException(e);
		}
		return SKIP_BODY;
	}

	public String getType() {
		return type == null ? "" : type;
	}

	public void setType(String type) {
		this.type = type;
	}

}
